<html>
<head>
<title>
Test page for Tables
</title>
</head>
<body>

<script language=javascript>

function addRow() {

    var tbody = document.getElementById('t1' ).getElementsByTagName("TBODY")[0];

    // Create a TR
    var row = document.createElement("TR");
    row.setAttribute("class", "normal");
    row.setAttribute("border", "1");
    
    for (j=0 ; j < document.getElementById('t1' ).rows[1].cells.length; j++) {
       // Create a TD 
       var td = document.createElement("TD");
       td.setAttribute("border","1");
       td.innerHTML = "New Cell";

       // Assign TD to TR and then assign TR to TBODY
        row.appendChild(td);
    }
    tbody.appendChild(row);
}

</script>


CVS Revision: "$Revision: 1.0 $"
<br>
<br>
    <table border="1" id='tblTest' cellspacing="3" cellpadding="6" class="TableClass">
    <tr>
      <td> Row 1 Col1</td>
      <td> Row 1 Col2</td>
  </tr>  <tr>
      <td> Row 2 Col1</td>
      <td> Row 2 Col2</td>  
      </tr>
</table>


<br>
<br>
<table id= 't1'>
    <Tr><td id=cell_with_colspan colspan=2>Table 2
    <tr>
      <td id=cell1> Row 1 Col1</td>
      <td> Row 1 Col2</td>
      </tr>
    <tr id=row1>
      <td> Row 2 Col1</td>
      <td> Row 2 Col2</td>
      </tr>
    <tr>
      <td> Row 3 Col1</td>
      <td> Row 3 Col2</td>
      </tr>
    <tr>
      <td> Row 4 Col1</td>
      <td> Row 4 Col2</td>
</tr>
</table>
<br>
<input type=button value='add row' onClick='javascript:addRow()'>

<br>
<br>

The following has a nested table
<table id='t2' border=1>
<tr>
<td>
cell 1</td>
<td>
cell2</td>
</tr>
<tr>
<td>
    <table><tr><td>nest1</td><td>nest2</td></tr></table>
    </td>
<td>
Normal
</td>
</tr>
</table>
<br>
This table has 3 body tags.
<br><br>
<table id=body_test>
<THEAD>
<TR>
<TD>
This text is in the THEAD.
</TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>
This text is in the FRST TBODY.
</TD>
</TR>
</TBODY>

<TBODY>
<TR>
<TD>
This text is in the SECOND TBODY.
</TD>
</TR>
<TR>
<TD>
This text is also in the SECOND TBODY.
</TD>
</TR>
</TBODY>

<TBODY>
<TR>
<TD>
This text is in the THIRD TBODY.
</TD>
</TR>
</TBODY>

</TABLE>

<table border="1" id=pic_table>
<tr>
  <td> A picture is in the next cell</td>
  <td><img src=images/circle.jpg></td>
</tr><tr>
  <td> A link is in the next cell</td>
  <td><a href = http://google.com>Google</a></td>
</tr>
</table>
Table to string test
    <table border="1" id='tblTest1' cellspacing="3" cellpadding="6" class="TableClass">
        <tr><td id=cellwithcolspan colspan=2>Table 3</td></tr>
    <tr>
      <td id=cell1> Row 1 Col1</td>
      <td> Row 1 Col2</td>
      </tr>
    <tr id=row1>
      <td> Row 2 Col1</td>
      <td> Row 2 Col2</td>
      </tr>
    <tr>
      <td> Row 3 Col1</td>
      <td> Row 3 Col2</td>
      </tr>
    <tr>
      <td> Row 4 Col1</td>
      <td> Row 4 Col2</td>
      </tr>
</table>
</body>
</html>
